﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class HotelController
    {
        public int InsertHotel(HotelInfo info)
        {
            return SQL.InsertHotel(info.PartnerId, info.HotelTypeId, info.HotelFullName, info.HotelSortName, info.HotelEnglishName, info.SortDescription, info.DetailDescrtiption, info.FloorQuantity, info.ContinentId, info.NationalId, info.CityId, info.DistrictId, info.WardId, info.Address, info.RepresentName, info.RepresentPhone, info.RepresentHotline, info.RepresentFax, info.RepresentEmail, info.RepresentWebsite, info.Utilities, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status, info.ScheduleShip, info.Item_Type);
        }
        public void UpdateHotel(HotelInfo info)
        {
            SQL.UpdateHotel(info.HotelId, info.PartnerId, info.HotelTypeId, info.HotelFullName, info.HotelSortName, info.HotelEnglishName, info.SortDescription, info.DetailDescrtiption, info.FloorQuantity, info.ContinentId, info.NationalId, info.CityId, info.DistrictId, info.WardId, info.Address, info.RepresentName, info.RepresentPhone, info.RepresentHotline, info.RepresentFax, info.RepresentEmail, info.RepresentWebsite, info.Utilities, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status, info.ScheduleShip, info.Item_Type);
        }
        public void DeleteHotel(HotelInfo info)
        {
            DeleteHotel(info.HotelId);
        }
        public void DeleteHotel(int hotelId)
        {
            SQL.DeleteHotel(hotelId);
        }
        public HotelInfo GetHotel(int hotelId)
        {
            return CBO.FillObject<HotelInfo>(SQL.GetHotel(hotelId));
        }
        public HotelInfo GetHotelByRoom(int roomId)
        {
            return CBO.FillObject<HotelInfo>(SQL.GetHotelByRoom(roomId));
        }
        public List<HotelInfo> ListHotel()
        {
            return CBO.FillCollection<HotelInfo>(SQL.ListHotel());
        }
        public DataTable SelectHotel()
        {
            return CBO.ConvertToDataTable(ListHotel(), typeof(HotelInfo));
        }
        public Dictionary<object, object> ListHotelLookup()
        {
            var users = ListHotel();
            var dicusers = new Dictionary<object, object>();
            foreach (HotelInfo info in users)
                dicusers.Add(info.HotelId, info.HotelFullName);

            return dicusers;
        }
    }
}
